{include header}
<script type="text/javascript">
	window.page_id = 1;

</script>
<div class="wrapper">
    {include header_menu}
    {include left_menu}
    <div class="main-container">
        <div class="padding-md">
            <h2 class="header-text">
                用户日志
            </h2>
            <div id="">
                <button style="margin-bottom: 10px;" class="btn btn-success" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
                    <span class="fa fa-search" aria-hidden="true"></span> 搜索
                </button>
                <div class="collapse {if X('get.search_submit')}in{/if}" id="collapseExample">
                    <div class="well">
                        <form action="{php HYBBS_URL(ACTION_NAME,METHOD_NAME,['pageid'=>1])}" method="get" class="form-horizontal" onsubmit="return search_from(this)">
                            <div class="row">
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label for="uid" class="col-sm-2 control-label">UID</label>
                                        <div class="col-sm-10">
                                            <input type="text" class="form-control" name="uid" id="uid" placeholder="完整用户UID" value="{php echo X('get.uid')}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="user" class="col-sm-2 control-label">用户名</label>
                                        <div class="col-sm-10">
                                            <input type="text" name="user" class="form-control" id="user" placeholder="完整用户名" value="{php echo X('get.user')}">
                                        </div>
                                    </div>
                                   
                                    
                                </div>
                                <div class="col-lg-6">
                                    
                                </div>
                                <div class="col-lg-12">
                                    <div class="form-group">
                                        <div class="col-md-5 col-md-offset-2">
                                            <input type="hidden" name="search_submit" value="search_submit">
                                            <button type="submit" name="search_submit" value="search_submit" class="btn btn-primary">
                                                <span class="fa fa-search" aria-hidden="true"></span> 搜索
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div><!-- 搜索 -->
			<div class="table-responsive">
				<table class="table table-striped table-bordered m-top-md" style="table-layout:fixed; word-break:break-all; word-wrap:break-word;">
	            	<thead>
	            		<tr class="bg-dark-blue">
		            		<th style="width:20%">用户名 [UID]</th>
		            		<th style="width:20%">金币</th>
		            		<th style="width:20%">积分</th>
		            		<th style="width:20%">变动原因</th>
		            		<th style="width:20%">时间</th>
	            		</tr>
	            	</thead>
	            	<tbody id="tbody">
		            	{foreach $data as $v}
		            	<tr>
		            		<td>{php echo M('User')->uid_to_user($v['uid'])}<small class="badge badge-success badge-square bounceIn animation-delay2 m-left-xs pull-right">{$v.uid}</small></td>
		            		<td style="color:{if $v['gold'] < 0}red{else}forestgreen{/if}">{if $v['gold']>0}+{/if}{$v.gold}</td>
		            		<td style="color:{if $v['credits'] < 0}red{else}forestgreen{/if}">{if $v['credits']>0}+{/if}{$v.credits}</td>
		            		<td>{$v.content}</td>
		            		<td>{php echo date('Y-m-d H:is',$v['atime'])}</td>
		            	</tr>
		            	{/foreach}
	            	</tbody>
	            </table>
	        </div>
            <nav aria-label="..." class="text-center">
                <ul class="pagination ">
                {if $pageid!=1}
                    <li class="">
                        <a href="{php HYBBS_URl(ACTION_NAME,METHOD_NAME,['pageid'=>$pageid-1])}{$x}" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
                    </li>
                {/if}
                <?php $tmp = $page_count ?>

                {for $i=($pageid-5 < 1) ? 1 : $pageid -5; $i< (($pageid + 5 > $tmp) ? $tmp+1 : $pageid + 5) ; $i++}
                <li class="{if $pageid == $i}active{/if}">
                    <a href="{php HYBBS_URl(ACTION_NAME,METHOD_NAME,['pageid'=>$i])}{$x}"  >
                    {$i}
                    </a>
                </li>
                {/for}
                {if $pageid!=$page_count}
                <li>
                    <a href="{php HYBBS_URl(ACTION_NAME,METHOD_NAME,['pageid'=>$pageid+1])}{$x}" aria-label="Next"><span aria-hidden="true">»</span></a>
                </li>
                {/if}
                </ul>
            </nav>
            

        </div>
    </div><!-- ENd box  -->

<script type="text/javascript">
    function search_from(obj){
        var data = $(obj).serialize();
        window.location.href='{php HYBBS_URL(ACTION_NAME,METHOD_NAME)}?'+data;//+'&pageid=1';
        return false;
    }
</script>
{include footer}